{:W('Template/top')}
<div class="wrapper clearfix content" style="position: relative;border: 1px solid #ddd">
    {:W('Template/left')}
    <form class="form-inline" method="get"
          action="{:U('Provider/auditGeneralProduct',array('state'=>0,'id'=>I('get.id')))}">
        <div class="rightbox pull-right">
            <div class="ur-here">您当前的位置：<a href="#">供应商管理</a>&gt;审核通用产品</div>
            <div class="cTitle2">审核通用产品</div>
            <div class="main-search">
                <div class="top" style="margin-bottom:0px;">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="请输入产品名称" name='name' value="{$name}">
                    </div>
                    <input type="submit" class="btn btn-warning" value='查询'>
                </div>
            </div>
            <in name="Think.session.role_id" value="$operatorData">
                <input type="hidden" class="operatorId" value="{$oid}">

                <div class="status">
                    <label>运营商：</label>
                    <foreach name="operatorList" item="vo">
                        <a class="nav-operator-report-state nav-operator-report-state{$vo.id}"
                           href="{:U('Provider/auditGeneralProduct', array('id' => I('get.id'), 'oid' => $vo['id'], 'state' => I('get.state')))}">{$vo.display_name}
                        </a>
                    </foreach>
                </div>
            </in>
            <div class="status">
                <input type="hidden" id="changeAudit" value="{:U('Provider/auditGeneralProduct')}">
                <label>状态：</label>
                <a class="navi-audit-state navi-audit-state0"
                   href="{:U('Provider/auditGeneralProduct',array('state'=>0,'id'=>I('get.id'), 'oid' => I('get.oid')))}">全部
                    <if condition="$state eq 0">({$total})</if>
                </a>
                <a class="navi-audit-state navi-audit-state3"
                   href="{:U('Provider/auditGeneralProduct',array('state'=>3,'id'=>I('get.id'), 'oid' => I('get.oid')))}">待审核
                    <if condition="$state eq 3">({$total})</if>
                </a>
                <a class="navi-audit-state navi-audit-state2"
                   href="{:U('Provider/auditGeneralProduct',array('state'=>2,'id'=>I('get.id'), 'oid' => I('get.oid')))}">审核通过
                    <if condition="$state eq 2">({$total})</if>
                </a>
                <a class="navi-audit-state navi-audit-state4"
                   href="{:U('Provider/auditGeneralProduct',array('state'=>4,'id'=>I('get.id'), 'oid' => I('get.oid')))}">拒绝
                    <if condition="$state eq 4">({$total})</if>
                </a>
                <a class="navi-audit-state navi-audit-state5"
                   href="{:U('Provider/auditGeneralProduct',array('state'=>5,'id'=>I('get.id'), 'oid' => I('get.oid')))}">已下架
                    <if condition="$state eq 5">({$total})</if>
                </a>
            </div>
            <table class="cTable table-hover" width="100%">
                <tr>
                    <th width="6%">代码</th>
                    <th width='15%'>产品名程</th>
                    <th width='10%'>供应商</th>
                    <th width='10%'>佣金比例</th>
                    <th width='10%'>同行价</th>
                    <th width='10%'>参数</th>
                    <th width='12%'>状态</th>
                    <th width='15%'>创建时间</th>
                    <th width="14%">操作</th>
                </tr>
                <volist name='info' id='v'>
                    <tr>
                        <td>20{$v.id}</td>
                        <td width="22%" class="text-c1" style="padding:2px 0 0 2px">{$v.name}</td>
                        <td>{$v.user_name}</td>
                        <td>{$v['commission_rate'] / 1000}‰</td>
                        <td class='text-c5'><dfn>&yen;{$v.price_agency|getYuan}</dfn></td>
                        <td class='text-c1'>
                            <if condition="$v['para_type'] eq 1">
                                保险 {$v.para_value}
                            </if>
                        </td>
                        {/*5表示已下架，2表示已上架*/}
                        <td class="show_msg">
                            <if condition="$v.state eq 1"><span style="color:#000666">未提交</span>
                                <elseif condition="$v.state eq 2"/>
                                <span style="color:blue">已审核，已上架</span>
                                <elseif condition="$v.state eq 3"/>
                                <span style="color:darkgreen">已提交，待审核</span>
                                <elseif condition="$v.state eq 4"/>
                                <a href="javascript:void(0)" data-toggle="tooltip" data-placement="top"
                                   title="{$v.audit_memo}" style="text-decoration: none"><span
                                        style="color:red">拒绝</a></span>
                                <elseif condition="$v.state eq 5"/>
                                <span style="color:red">已下架</span>
                            </if>
                        </td>
                        <td>{$v.create_time}</td>
                        <td>
                            {/*1表示待审核，3表示已审核，4表示拒绝*/}
                            <div class="btn-group">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                                        aria-expanded="false">
                                    操作<span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a onclick="changeState({$v.id}, {:Common\\Top::ProductStateIsSale})"
                                           style="cursor: pointer">已审核</a></li>
                                    <li><a onclick="reject({$v.id}, {:Common\\Top::ProductStateRejected})"
                                           style="cursor: pointer">拒绝</a></li>
                                    <li><a onclick="setCommission({$v.id}, '{$v.id|setEncrypt}')" style="cursor: pointer">佣金设置</a></li>
                                    <li><a href="{:U('Product/edit',array('id'=>I('get.id'), 'tid'=>$v['id']))}">编辑</a></li>
                                </ul>
                            </div>

                        </td>
                    </tr>
                </volist>
            </table>
            <notempty name="info">
                <div class="pagebox">
                    {$page}
                </div>
            </notempty>
        </div>
    </form>
</div>

<div class="theme-popover">
    <div class="theme-poptit" style="border-bottom: 1px solid #e5e5e5;">
        <a title="关闭" class="closes">&times;</a>

        <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">拒绝理由</h4>
        </div>
        <div class="modal-body" id="modal_reject">
            <textarea class="form-control" name="reason" style="resize: none;" placeholder="请填写拒绝理由"></textarea>
        </div>
        <div class="modal-footer pull-right">
            <button type="button" class="btn btn-warning" id="button">确定</button>
            <button type="button" class="btn btn-default " id="reset">取消</button>
        </div>
    </div>
</div>

<div class="modal fade" id="myModalEdit" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:300px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close"
                        data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title">
                    佣金设置
                </h4>
            </div>
            <div class="modal-body">
                佣金比例：
                <div class="input-group">
                    <input type="text" class="commission_rate form-control" style="border:1px solid #e5e5e5">
                    <span class="input-group-addon">‰</span>
                </div>
            </div>
            <div class="modal-footer">
                <div class="pull-right">
                    <button type="button" class="btn btn-primary doSubmitTopup">
                        确定
                    </button>
                    <button type="button" class="btn btn-default cancel"
                            data-dismiss="modal">关闭
                    </button>
                </div>
            </div>
        </div>
    </div>
</div>
<input type="hidden" value="{:U('Provider/auditGeneralProduct')}" id="chkState"/>
<input type="hidden" value="{:U('Provider/saveGeneralProductCommission')}" id="saveCommission"/>
<input type="hidden" value="{:U('Provider/showGeneralProductCommission')}" id="showCommission"/>

<div class="theme-popover-mask"></div>
<input id='state' type='hidden' value='{$state}'/>
{:W('Template/bottom')}
<script>
    $(function () {
        $("[data-toggle='tooltip']").tooltip();
    });
</script>
</body>
</html>